<?php

namespace Modules\Wechat\Model\Util\Exception\Dao;

class Db extends \S\WeChat\Exception\Abstraction
{

    const CODE_COLUMN_NOT_EXISTS    = '0001';
    const CODE_PK_REQUIRED_UPDATING = '0002';
    const CODE_TOO_MUCH_PK          = '0003';

    protected function getCodePrefix()
    {
        return self::_CODE_PREFIX_DAO_DB;
    }

    protected function getCodeMessages()
    {
        return [
            self::CODE_COLUMN_NOT_EXISTS    => '列@column@不存在:请先在DAO中设置公开属性作为列.',
            self::CODE_PK_REQUIRED_UPDATING => '不能以空主键更新数据.',
            self::CODE_TOO_MUCH_PK          => '只能有一个主键的值.',
        ];
    }

    protected function beforeThrow()
    {
        return true;
    }

}